/*
 *  $Id: SpellAbilityCard.cs 1062 2010-05-20 16:33:54Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008-2009 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima {
    /// <summary>
    /// Способность, основанная на заклинании.
    /// </summary>
    public class SpellAbilityCard : AbilityCard {
        private SpellCard _spell;

        public SpellAbilityCard(SpellCard spell) : base(spell.Id + "__ability") {
            _spell = spell;
            SetPictureSource(spell);
            Level = CompleteLevel.ReadyForTest;
            Version = spell.Version;
            Element = spell.Element;
            AdditionalElement = spell.AdditionalElement;
            Category = spell.Category;
            Target = spell.Target;
            ManaCost.Increment(spell.ManaCost);
            foreach (Condition condition in spell.GetConditions())
                AddCondition(condition);
            AllowInOffence = spell.AllowInOffence;
            AllowInDefence = spell.AllowInDefence;
        }

        public SpellCard Spell {
            get { return _spell; }
        }

        public override Languages.Names Name {
            get { return _spell.Name; }
        }

        public override Languages.Phrase Description {
            get { return _spell.Description; }
        }

        public override string DescriptionText {
            get { return _spell.DescriptionText; }
        }

        public override void ManaCostAction(TargetArgs args, ElementValues manas) {
            _spell.ManaCostAction(args, manas);
        }

        public override bool IsPossibleAction(TargetArgs args) {
            return _spell.IsPossibleAction(args);
        }

        public override void LogAction(Log log, TargetArgs args) {
            _spell.LogAction(log, args);
        }

        public override void DoAction(TargetArgs args) {
            _spell.DoAction(args);
        }
    }
}
